﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Model;

namespace GataBaseSys
{
    public partial class DetailPage : System.Web.UI.Page
    {
        GataBaseBLL bll = new GataBaseBLL();
        Auction auction = new Auction();
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request["id"]))
                {
                    //获取修改ID
                    int id = Convert.ToInt32(Request["id"]);
                    //获取修改数据
                    var info = bll.GetListALL().Where(a => a.AuctionID == id).SingleOrDefault();
                    this.MyImg.Src = ".." + info.AuctionPicture;
                    this.lblName.Text = info.AuctionName;
                    this.lblAuctionCategory.Text = Convert.ToInt32(info.AuctionCategory).ToString();
                    this.lblPrice.Text = Convert.ToDecimal(info.AuctionPrice).ToString();
                    this.lblName.Text = info.AuctionName;
                    this.lblAuctionState.Text = info.AuctionState;

                    this.lblPrice1.Text= Convert.ToDecimal(info.AuctionPrice+100000).ToString();
                    //类型
                    if (info.AuctionCode == 1)
                    {
                        this.lblAuctionCode.Text = "写字楼";
                    }
                    else if (info.AuctionCode == 2)
                    {
                        this.lblAuctionCode.Text = "公寓";
                    }
                    else if (info.AuctionCode == 3)
                    {
                        this.lblAuctionCode.Text = "住宅";
                    }
                    else if (info.AuctionCode == 4)
                    {
                        this.lblAuctionCode.Text = "商业";
                    }
                    else if (info.AuctionCode == 5)
                    {
                        this.lblAuctionCode.Text = "别墅";
                    }
                    else if (info.AuctionCode == 6)
                    {
                        this.lblAuctionCode.Text = "自由购";
                    }
                    //地区判断
                    if (info.AuctionCategory==1)
                    {
                        this.lblAuctionCategory.Text = "北京";
                    }
                    else if (info.AuctionCategory==2)
                    {
                        this.lblAuctionCategory.Text = "上海";
                    }
                    else if (info.AuctionCategory == 2)
                    {
                        this.lblAuctionCategory.Text = "重庆";
                    }
                    else if (info.AuctionCategory == 2)
                    {
                        this.lblAuctionCategory.Text = "广州";
                    }
                    else if (info.AuctionCategory == 2)
                    {
                        this.lblAuctionCategory.Text = "深圳";
                    }
                    else if (info.AuctionCategory == 2)
                    {
                        this.lblAuctionCategory.Text = "贵州";
                    }
                }
            }
            //修改显示值

        }
    }
}